package shopsession

import (
	"YingShop/log"

	"github.com/gin-contrib/sessions"
	"github.com/gin-contrib/sessions/redis"
	"github.com/gin-gonic/gin"
)

var ShopSession gin.HandlerFunc

func init() {
	log.Info("session loading")
	store, err := redis.NewStore(10, "tcp", "192.168.8.129:6379", "", []byte("secret"))
	if err != nil {
		log.Error(err.Error())
	}
	ShopSession = sessions.Sessions("mysession", store)
}
